<template>
    {{ list }}
    <ul>
        <li v-for="item in list" :key="item.id">
            <div>
                <p><img :src="item.image" alt=""  style="width: 100%;"></p>
                <p>{{ item.title }}</p>
                <p style="color: red;">￥{{ item.price }}</p>
            </div>
        </li>
    </ul>
</template>
<script setup>
    import request from '@/utils/request.js'
   
    import {onMounted,ref} from 'vue'
    const list=ref([])
    onMounted(()=>{
        request.get('/list',{
            params:{
                pagination: 1, pageNum:5
            }
        }).then(res=>{
            if(res.data.code==200){
                list.value==res.data.data
            }
        })
    })
</script>